package com.hxzy.mapper;

import com.hxzy.dto.back.MerchandiserSearchDTO;
import com.hxzy.entity.Merchandiser;
import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 商家信息
 */
@Mapper
public interface MerchandiserMapper  extends MyBatisBaseDao<Merchandiser,BigDecimal> {

    /**
     * 分页查询
     * @param dto
     * @return
     */
    List<Merchandiser> search(@Param(value = "dto") MerchandiserSearchDTO dto);


    /**
     * 验证商家手机号码是否存在
     * @param loginName
     * @return
     */
    @Select(value = "select count(*) from MERCHANDISER where LOGIN_NAME=#{loginName} ")
    int existsLoginName(String loginName);


    Merchandiser findByLoginName(String loginName);

    /**
     * 验证商家手机号码是否存在
     * @param loginName
     * @return
     */
    Merchandiser existsLoginNameAndNoPassed(String loginName);
}